/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.DocProject
{
	public sealed class ProjectComparer<TProject> : IEqualityComparer<TProject>
		where TProject : IComparableProject
	{
		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ProjectComparer" /> class.
		/// </summary>
		public ProjectComparer()
		{
		}
		#endregion

		#region IEqualityComparer<TProject> Members
		public bool Equals(TProject x, TProject y)
		{
			return x != null && x.Matches(y);
		}

		public int GetHashCode(TProject obj)
		{
			return obj.GetMatchCode();
		}
		#endregion
	}
}
